package com.rengl.javamvc.controller;

import com.rengl.javamvc.model.User;
import com.rengl.javamvc.service.UserService;
import com.rengl.javamvc.service.impl.UserServiceImpl;

import java.util.List;

/**
 * 控制器
 */
public class UserController {

    private UserService userService = new UserServiceImpl();


    /**
     * 用户注册
     * 接
     * 调
     * 返
     */
    public String  register(User user){//接

        //调
        userService.add(user);

        //返
        return "success";
    }

    public List<User> list() {//接

        List<User> list = userService.list();//调
        return list;
    }
}
